import httpService from '@/utils/http.js'

//post
export function postAction(url, parameter) {
  return httpService({
    url: url,
    method: 'post',
    data: parameter
  })
}

export function postAction1(url, parameter) {
  return httpService({
    url: url,
    method: 'post',
    params: parameter
  })
}

//post method= {post | put}
export function httpAction(url, parameter, method) {
  return httpService({
    url: url,
    method: method,
    data: parameter
  })
}

//put
export function putAction(url, parameter) {
  return httpService({
    url: url,
    method: 'put',
    data: parameter
  })
}

export function putAction1(url, parameter) {
  return httpService({
    url: url,
    method: 'put',
    params: parameter
  })
}

//get
export function getAction(url, parameter) {
  return httpService({
    url: url,
    method: 'get',
    params: parameter
  })
}
//get
export function downloadAction(url, parameter) {
  return httpService({
    url: url,
    method: 'get',
    params: parameter,
    responseType: 'blob'
  })
}
//deleteAction
export function deleteAction(url, parameter) {
  return httpService({
    url: url,
    method: 'delete',
    params: parameter
  })
}
